<?php

namespace app\admin\validate;

use think\Validate;

class Cate extends Validate
{
   
	protected $rule = [
        'catename'    =>   'require|unique:cate',
        'pid'         =>   'require|number',
        'model_id'    =>    'require|number',
        'type'        =>    'require|number',
    ];
    
    protected $message = [
        'catename.require'   =>'栏目名称必须填写',
        'catename.unique'    =>'栏目名称已存在',
        'pid.require'        =>'上级栏目不能为空',
        'pid.number'         =>'上级栏目id必须为数字',
        'type.require'       =>'栏目属性不能为空！',
		'type.number'        =>'栏目属性必须是数字！',
		'model_id.number'    =>'模型id必须是数字！',
		'model_id.require'   =>'模型名称不得为空！',
    ];
    protected $scene=[
		'save'=>['model_id','pid','catename','type'],
		'edit'=>['model_id','pid','catename','type'],
	];
}
